package br.com.r1.jpastandalone.utils;

import javax.persistence.EntityManager;

import br.com.r1.jpastandalone.models.Customer;

public abstract class GenericTests<T> {

	protected EntityManager em = JPAUtils.getEntityManager();
	
	public T getInstance(Class clazz) throws InstantiationException, IllegalAccessException{
		return (T)clazz.newInstance();
	}
	
	protected abstract void testCompleto() throws Exception;
	protected abstract T testInsereContextoPersistenciaExtendidoDentroDeTransacao() throws Exception;
	protected abstract void testInsertEmContextoPersistenciaExtendidoForaDeTransacao() throws Exception;
	protected abstract void testBuscaChavePrimariaAtravesDosDoisTiposDeBuscaGetReferenceEFind(Object id) throws Exception;
	protected abstract T testGetReference(Object id) throws Exception;
	protected abstract T testFind(Object id) throws Exception;
	protected abstract T testAlteraEmContextoPersistenciaExtendidoForaDeTransacao(Object id, T c) throws Exception;
	protected abstract void testDeletaEmContextoPersistenciaExtendidoForaDeTransacao(Object id) throws Exception;
}
